@model ToDoListWeb.Models.UserModel
@{
    Layout = null;
}

@if (Model.Type != null)
{
    foreach (var item in Model.Type)
    {
        <div class="type">
            <h5 class="type-title" onclick="pullDown(@(item.TypeName+item.TypeId))">@item.TypeName</h5>
            <div class="type-menu" id=@item.TypeName onclick="clearButton(@item.TypeName,@item.TypeId)">······</div>
        </div>
        <ul id=@(item.TypeName+item.TypeId) class="typeName">
            @if (Model.Inventory != null)
            {
                @foreach (var inv in Model.Inventory.Where(i => i.TypeId == item.TypeId).ToList())
                {
                    <li>
                        <a id="a-inventory" class="a-inventory-name" onclick="chooseInventory(@inv.InventoryId)">
                            <span>@inv.InventoryName</span>
                        </a>
                        <a id="a-delete" onclick="deleteInventory(@inv.InventoryId)"><img src="~/images/删除.png" id="delete-img"></a>
                        <a id="a-compile" href="/Inventory/CompileInventoryView?inventoryId=@inv.InventoryId"><img id="compile-img-inventory" src="~/images/编辑.png"></a>
                    </li>
                }
            }
        </ul>
    }
}